package entity

import "time"

type Repository struct {
	RID                 int64      `json:"rid" gorm:"primaryKey,autoIncrement"`
	ID                  int        `json:"id"`
	FullName            string     `json:"full_name"`
	HumanName           string     `json:"human_name"`
	URL                 string     `json:"url"`
	NamespaceId         int64      `gorm:"column:namespace_id"`
	Namespace           Namespace  `json:"namespace" gorm:"-"`
	Path                string     `json:"path"`
	Name                string     `json:"name"`
	OwnerId             int64      `gorm:"column:owner_id"`
	Owner               Owner      `json:"owner" gorm:"-"`
	AssignerId          int64      `gorm:"column:assigner_id"`
	Assigner            Assigner   `json:"assigner" gorm:"-"`
	Description         string     `json:"description"`
	Private             bool       `json:"private"`
	Public              bool       `json:"public"`
	Internal            bool       `json:"internal"`
	Fork                bool       `json:"fork"`
	HTMLURL             string     `json:"html_url"`
	SSHURL              string     `json:"ssh_url"`
	ForksURL            string     `json:"forks_url"`
	KeysURL             string     `json:"keys_url"`
	CollaboratorsURL    string     `json:"collaborators_url"`
	HooksURL            string     `json:"hooks_url"`
	BranchesURL         string     `json:"branches_url"`
	TagsURL             string     `json:"tags_url"`
	BlobsURL            string     `json:"blobs_url"`
	StargazersURL       string     `json:"stargazers_url"`
	ContributorsURL     string     `json:"contributors_url"`
	CommitsURL          string     `json:"commits_url"`
	CommentsURL         string     `json:"comments_url"`
	IssueCommentURL     string     `json:"issue_comment_url"`
	IssuesURL           string     `json:"issues_url"`
	PullsURL            string     `json:"pulls_url"`
	MilestonesURL       string     `json:"milestones_url"`
	NotificationsURL    string     `json:"notifications_url"`
	LabelsURL           string     `json:"labels_url"`
	ReleasesURL         string     `json:"releases_url"`
	Recommend           bool       `json:"recommend"`
	Gvp                 bool       `json:"gvp"`
	Homepage            string     `json:"homepage"`
	Language            string     `json:"language"`
	ForksCount          int        `json:"forks_count"`
	StargazersCount     int        `json:"stargazers_count"`
	WatchersCount       int        `json:"watchers_count"`
	DefaultBranch       string     `json:"default_branch"`
	OpenIssuesCount     int        `json:"open_issues_count"`
	HasIssues           bool       `json:"has_issues"`
	HasWiki             bool       `json:"has_wiki"`
	IssueComment        bool       `json:"issue_comment"`
	CanComment          bool       `json:"can_comment"`
	PullRequestsEnabled bool       `json:"pull_requests_enabled"`
	HasPage             bool       `json:"has_page"`
	License             string     `json:"license"`
	Outsourced          bool       `json:"outsourced"`
	ProjectCreator      string     `json:"project_creator"`
	Members             []string   `json:"members" gorm:"serializer:json"`
	PushedAt            time.Time  `json:"pushed_at"`
	CreatedAt           time.Time  `json:"created_at"`
	UpdatedAt           time.Time  `json:"updated_at"`
	Parent              string     `json:"parent"`
	Paas                string     `json:"paas"`
	AssigneesNumber     int        `json:"assignees_number"`
	TestersNumber       int        `json:"testers_number"`
	Assignee            []Assigner `json:"assignee" gorm:"serializer:json"`
	Testers             []Assigner `json:"testers" gorm:"serializer:json"`
	Status              string     `json:"status"`
	Programs            []string   `json:"programs" gorm:"serializer:json"`
	Enterprise          string     `json:"enterprise" gorm:"serializer:json"`
	ProjectLabels       []string   `json:"project_labels" gorm:"serializer:json"`
}

type Namespace struct {
	NID     int64  `json:"nid" gorm:"primaryKey,autoIncrement"`
	ID      int    `json:"id"`
	Type    string `json:"type"`
	Name    string `json:"name"`
	Path    string `json:"path"`
	HTMLURL string `json:"html_url"`
}

type Owner struct {
	OID               int64  `json:"oid" gorm:"primaryKey,autoIncrement"`
	ID                int    `json:"id"`
	Login             string `json:"login"`
	Name              string `json:"name"`
	AvatarURL         string `json:"avatar_url"`
	URL               string `json:"url"`
	HTMLURL           string `json:"html_url"`
	Remark            string `json:"remark"`
	FollowersURL      string `json:"followers_url"`
	FollowingURL      string `json:"following_url"`
	GistsURL          string `json:"gists_url"`
	StarredURL        string `json:"starred_url"`
	SubscriptionsURL  string `json:"subscriptions_url"`
	OrganizationsURL  string `json:"organizations_url"`
	ReposURL          string `json:"repos_url"`
	EventsURL         string `json:"events_url"`
	ReceivedEventsURL string `json:"received_events_url"`
	Type              string `json:"type"`
}

type Assigner struct {
	AID               int64  `json:"aid" gorm:"primaryKey"`
	ID                int    `json:"id"`
	Login             string `json:"login"`
	Name              string `json:"name"`
	AvatarURL         string `json:"avatar_url"`
	URL               string `json:"url"`
	HTMLURL           string `json:"html_url"`
	Remark            string `json:"remark"`
	FollowersURL      string `json:"followers_url"`
	FollowingURL      string `json:"following_url"`
	GistsURL          string `json:"gists_url"`
	StarredURL        string `json:"starred_url"`
	SubscriptionsURL  string `json:"subscriptions_url"`
	OrganizationsURL  string `json:"organizations_url"`
	ReposURL          string `json:"repos_url"`
	EventsURL         string `json:"events_url"`
	ReceivedEventsURL string `json:"received_events_url"`
	Type              string `json:"type"`
}
